package oop3;

/**
 * @author oldliu
 * @since 1.0
 */
public class Student {
    private String name;
    private int age;
    private String phone;
    public Student(){

    }
    public Student(String name,int age,String phone){
        this.name=name;
        setAge(age);
        //this.age=age;

        this.phone=phone;
    }
    public int getAge(){
        return age;
    }
    public void setAge(int a){
        if(a<1||a>100){
            System.out.println("年龄错误");
            return;
        }
        age=a;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    private void cry(){
        System.out.println(name+"正在哭");
    }
    public void show(){
        System.out.println("姓名："+name);
        System.out.println("age："+age+"岁");
        System.out.println("手机号："+phone);
    }
}
